<?php

/**
 * Order.
 *
 * PHP version 8.3
 *
 * @category Class
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 */

/**
 * Selling Partner API for Orders.
 *
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * The version of the OpenAPI document: v0
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.9.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace SpApi\Model\orders\v0;

use SpApi\Model\ModelInterface;
use SpApi\ObjectSerializer;

/**
 * Order Class Doc Comment.
 *
 * @category Class
 *
 * @description Order information.
 *
 * @author   OpenAPI Generator team
 *
 * @see     https://openapi-generator.tech
 *
 * @implements \ArrayAccess<string, mixed>
 */
class Order implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    public const ORDER_STATUS_PENDING = 'Pending';
    public const ORDER_STATUS_UNSHIPPED = 'Unshipped';
    public const ORDER_STATUS_PARTIALLY_SHIPPED = 'PartiallyShipped';
    public const ORDER_STATUS_SHIPPED = 'Shipped';
    public const ORDER_STATUS_CANCELED = 'Canceled';
    public const ORDER_STATUS_UNFULFILLABLE = 'Unfulfillable';
    public const ORDER_STATUS_INVOICE_UNCONFIRMED = 'InvoiceUnconfirmed';
    public const ORDER_STATUS_PENDING_AVAILABILITY = 'PendingAvailability';
    public const FULFILLMENT_CHANNEL_MFN = 'MFN';
    public const FULFILLMENT_CHANNEL_AFN = 'AFN';
    public const PAYMENT_METHOD_COD = 'COD';
    public const PAYMENT_METHOD_CVS = 'CVS';
    public const PAYMENT_METHOD_OTHER = 'Other';
    public const ORDER_TYPE_STANDARD_ORDER = 'StandardOrder';
    public const ORDER_TYPE_LONG_LEAD_TIME_ORDER = 'LongLeadTimeOrder';
    public const ORDER_TYPE_PREORDER = 'Preorder';
    public const ORDER_TYPE_BACK_ORDER = 'BackOrder';
    public const ORDER_TYPE_SOURCING_ON_DEMAND_ORDER = 'SourcingOnDemandOrder';
    public const BUYER_INVOICE_PREFERENCE_INDIVIDUAL = 'INDIVIDUAL';
    public const BUYER_INVOICE_PREFERENCE_BUSINESS = 'BUSINESS';

    /**
     * The original name of the model.
     */
    protected static string $openAPIModelName = 'Order';

    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static array $openAPITypes = [
        'amazon_order_id' => 'string',
        'seller_order_id' => 'string',
        'purchase_date' => 'string',
        'last_update_date' => 'string',
        'order_status' => 'string',
        'fulfillment_channel' => 'string',
        'sales_channel' => 'string',
        'order_channel' => 'string',
        'ship_service_level' => 'string',
        'order_total' => '\SpApi\Model\orders\v0\Money',
        'number_of_items_shipped' => 'int',
        'number_of_items_unshipped' => 'int',
        'payment_execution_detail' => '\SpApi\Model\orders\v0\PaymentExecutionDetailItem[]',
        'payment_method' => 'string',
        'payment_method_details' => 'string[]',
        'marketplace_id' => 'string',
        'shipment_service_level_category' => 'string',
        'easy_ship_shipment_status' => '\SpApi\Model\orders\v0\EasyShipShipmentStatus',
        'cba_displayable_shipping_label' => 'string',
        'order_type' => 'string',
        'earliest_ship_date' => 'string',
        'latest_ship_date' => 'string',
        'earliest_delivery_date' => 'string',
        'latest_delivery_date' => 'string',
        'is_business_order' => 'bool',
        'is_prime' => 'bool',
        'is_premium_order' => 'bool',
        'is_global_express_enabled' => 'bool',
        'replaced_order_id' => 'string',
        'is_replacement_order' => 'bool',
        'promise_response_due_date' => 'string',
        'is_estimated_ship_date_set' => 'bool',
        'is_sold_by_ab' => 'bool',
        'is_iba' => 'bool',
        'default_ship_from_location_address' => '\SpApi\Model\orders\v0\Address',
        'buyer_invoice_preference' => 'string',
        'buyer_tax_information' => '\SpApi\Model\orders\v0\BuyerTaxInformation',
        'fulfillment_instruction' => '\SpApi\Model\orders\v0\FulfillmentInstruction',
        'is_ispu' => 'bool',
        'is_access_point_order' => 'bool',
        'marketplace_tax_info' => '\SpApi\Model\orders\v0\MarketplaceTaxInfo',
        'seller_display_name' => 'string',
        'shipping_address' => '\SpApi\Model\orders\v0\Address',
        'buyer_info' => '\SpApi\Model\orders\v0\BuyerInfo',
        'automated_shipping_settings' => '\SpApi\Model\orders\v0\AutomatedShippingSettings',
        'has_regulated_items' => 'bool',
        'electronic_invoice_status' => '\SpApi\Model\orders\v0\ElectronicInvoiceStatus'];

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     *
     * @phpstan-var array<string, string|null>
     *
     * @psalm-var array<string, string|null>
     */
    protected static array $openAPIFormats = [
        'amazon_order_id' => null,
        'seller_order_id' => null,
        'purchase_date' => null,
        'last_update_date' => null,
        'order_status' => null,
        'fulfillment_channel' => null,
        'sales_channel' => null,
        'order_channel' => null,
        'ship_service_level' => null,
        'order_total' => null,
        'number_of_items_shipped' => null,
        'number_of_items_unshipped' => null,
        'payment_execution_detail' => null,
        'payment_method' => null,
        'payment_method_details' => null,
        'marketplace_id' => null,
        'shipment_service_level_category' => null,
        'easy_ship_shipment_status' => null,
        'cba_displayable_shipping_label' => null,
        'order_type' => null,
        'earliest_ship_date' => null,
        'latest_ship_date' => null,
        'earliest_delivery_date' => null,
        'latest_delivery_date' => null,
        'is_business_order' => null,
        'is_prime' => null,
        'is_premium_order' => null,
        'is_global_express_enabled' => null,
        'replaced_order_id' => null,
        'is_replacement_order' => null,
        'promise_response_due_date' => null,
        'is_estimated_ship_date_set' => null,
        'is_sold_by_ab' => null,
        'is_iba' => null,
        'default_ship_from_location_address' => null,
        'buyer_invoice_preference' => null,
        'buyer_tax_information' => null,
        'fulfillment_instruction' => null,
        'is_ispu' => null,
        'is_access_point_order' => null,
        'marketplace_tax_info' => null,
        'seller_display_name' => null,
        'shipping_address' => null,
        'buyer_info' => null,
        'automated_shipping_settings' => null,
        'has_regulated_items' => null,
        'electronic_invoice_status' => null];

    /**
     * Array of nullable properties. Used for (de)serialization.
     *
     * @var bool[]
     */
    protected static array $openAPINullables = [
        'amazon_order_id' => false,
        'seller_order_id' => true,
        'purchase_date' => false,
        'last_update_date' => false,
        'order_status' => false,
        'fulfillment_channel' => true,
        'sales_channel' => true,
        'order_channel' => true,
        'ship_service_level' => true,
        'order_total' => true,
        'number_of_items_shipped' => true,
        'number_of_items_unshipped' => true,
        'payment_execution_detail' => true,
        'payment_method' => true,
        'payment_method_details' => true,
        'marketplace_id' => true,
        'shipment_service_level_category' => true,
        'easy_ship_shipment_status' => true,
        'cba_displayable_shipping_label' => true,
        'order_type' => true,
        'earliest_ship_date' => true,
        'latest_ship_date' => true,
        'earliest_delivery_date' => true,
        'latest_delivery_date' => true,
        'is_business_order' => true,
        'is_prime' => true,
        'is_premium_order' => true,
        'is_global_express_enabled' => true,
        'replaced_order_id' => true,
        'is_replacement_order' => true,
        'promise_response_due_date' => true,
        'is_estimated_ship_date_set' => true,
        'is_sold_by_ab' => true,
        'is_iba' => true,
        'default_ship_from_location_address' => true,
        'buyer_invoice_preference' => true,
        'buyer_tax_information' => true,
        'fulfillment_instruction' => true,
        'is_ispu' => true,
        'is_access_point_order' => true,
        'marketplace_tax_info' => true,
        'seller_display_name' => true,
        'shipping_address' => true,
        'buyer_info' => true,
        'automated_shipping_settings' => true,
        'has_regulated_items' => true,
        'electronic_invoice_status' => true,
    ];

    /**
     * If a nullable field gets set to null, insert it here.
     *
     * @var bool[]
     */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @var string[]
     */
    protected static array $attributeMap = [
        'amazon_order_id' => 'AmazonOrderId',
        'seller_order_id' => 'SellerOrderId',
        'purchase_date' => 'PurchaseDate',
        'last_update_date' => 'LastUpdateDate',
        'order_status' => 'OrderStatus',
        'fulfillment_channel' => 'FulfillmentChannel',
        'sales_channel' => 'SalesChannel',
        'order_channel' => 'OrderChannel',
        'ship_service_level' => 'ShipServiceLevel',
        'order_total' => 'OrderTotal',
        'number_of_items_shipped' => 'NumberOfItemsShipped',
        'number_of_items_unshipped' => 'NumberOfItemsUnshipped',
        'payment_execution_detail' => 'PaymentExecutionDetail',
        'payment_method' => 'PaymentMethod',
        'payment_method_details' => 'PaymentMethodDetails',
        'marketplace_id' => 'MarketplaceId',
        'shipment_service_level_category' => 'ShipmentServiceLevelCategory',
        'easy_ship_shipment_status' => 'EasyShipShipmentStatus',
        'cba_displayable_shipping_label' => 'CbaDisplayableShippingLabel',
        'order_type' => 'OrderType',
        'earliest_ship_date' => 'EarliestShipDate',
        'latest_ship_date' => 'LatestShipDate',
        'earliest_delivery_date' => 'EarliestDeliveryDate',
        'latest_delivery_date' => 'LatestDeliveryDate',
        'is_business_order' => 'IsBusinessOrder',
        'is_prime' => 'IsPrime',
        'is_premium_order' => 'IsPremiumOrder',
        'is_global_express_enabled' => 'IsGlobalExpressEnabled',
        'replaced_order_id' => 'ReplacedOrderId',
        'is_replacement_order' => 'IsReplacementOrder',
        'promise_response_due_date' => 'PromiseResponseDueDate',
        'is_estimated_ship_date_set' => 'IsEstimatedShipDateSet',
        'is_sold_by_ab' => 'IsSoldByAB',
        'is_iba' => 'IsIBA',
        'default_ship_from_location_address' => 'DefaultShipFromLocationAddress',
        'buyer_invoice_preference' => 'BuyerInvoicePreference',
        'buyer_tax_information' => 'BuyerTaxInformation',
        'fulfillment_instruction' => 'FulfillmentInstruction',
        'is_ispu' => 'IsISPU',
        'is_access_point_order' => 'IsAccessPointOrder',
        'marketplace_tax_info' => 'MarketplaceTaxInfo',
        'seller_display_name' => 'SellerDisplayName',
        'shipping_address' => 'ShippingAddress',
        'buyer_info' => 'BuyerInfo',
        'automated_shipping_settings' => 'AutomatedShippingSettings',
        'has_regulated_items' => 'HasRegulatedItems',
        'electronic_invoice_status' => 'ElectronicInvoiceStatus',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static array $setters = [
        'amazon_order_id' => 'setAmazonOrderId',
        'seller_order_id' => 'setSellerOrderId',
        'purchase_date' => 'setPurchaseDate',
        'last_update_date' => 'setLastUpdateDate',
        'order_status' => 'setOrderStatus',
        'fulfillment_channel' => 'setFulfillmentChannel',
        'sales_channel' => 'setSalesChannel',
        'order_channel' => 'setOrderChannel',
        'ship_service_level' => 'setShipServiceLevel',
        'order_total' => 'setOrderTotal',
        'number_of_items_shipped' => 'setNumberOfItemsShipped',
        'number_of_items_unshipped' => 'setNumberOfItemsUnshipped',
        'payment_execution_detail' => 'setPaymentExecutionDetail',
        'payment_method' => 'setPaymentMethod',
        'payment_method_details' => 'setPaymentMethodDetails',
        'marketplace_id' => 'setMarketplaceId',
        'shipment_service_level_category' => 'setShipmentServiceLevelCategory',
        'easy_ship_shipment_status' => 'setEasyShipShipmentStatus',
        'cba_displayable_shipping_label' => 'setCbaDisplayableShippingLabel',
        'order_type' => 'setOrderType',
        'earliest_ship_date' => 'setEarliestShipDate',
        'latest_ship_date' => 'setLatestShipDate',
        'earliest_delivery_date' => 'setEarliestDeliveryDate',
        'latest_delivery_date' => 'setLatestDeliveryDate',
        'is_business_order' => 'setIsBusinessOrder',
        'is_prime' => 'setIsPrime',
        'is_premium_order' => 'setIsPremiumOrder',
        'is_global_express_enabled' => 'setIsGlobalExpressEnabled',
        'replaced_order_id' => 'setReplacedOrderId',
        'is_replacement_order' => 'setIsReplacementOrder',
        'promise_response_due_date' => 'setPromiseResponseDueDate',
        'is_estimated_ship_date_set' => 'setIsEstimatedShipDateSet',
        'is_sold_by_ab' => 'setIsSoldByAb',
        'is_iba' => 'setIsIba',
        'default_ship_from_location_address' => 'setDefaultShipFromLocationAddress',
        'buyer_invoice_preference' => 'setBuyerInvoicePreference',
        'buyer_tax_information' => 'setBuyerTaxInformation',
        'fulfillment_instruction' => 'setFulfillmentInstruction',
        'is_ispu' => 'setIsIspu',
        'is_access_point_order' => 'setIsAccessPointOrder',
        'marketplace_tax_info' => 'setMarketplaceTaxInfo',
        'seller_display_name' => 'setSellerDisplayName',
        'shipping_address' => 'setShippingAddress',
        'buyer_info' => 'setBuyerInfo',
        'automated_shipping_settings' => 'setAutomatedShippingSettings',
        'has_regulated_items' => 'setHasRegulatedItems',
        'electronic_invoice_status' => 'setElectronicInvoiceStatus',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static array $getters = [
        'amazon_order_id' => 'getAmazonOrderId',
        'seller_order_id' => 'getSellerOrderId',
        'purchase_date' => 'getPurchaseDate',
        'last_update_date' => 'getLastUpdateDate',
        'order_status' => 'getOrderStatus',
        'fulfillment_channel' => 'getFulfillmentChannel',
        'sales_channel' => 'getSalesChannel',
        'order_channel' => 'getOrderChannel',
        'ship_service_level' => 'getShipServiceLevel',
        'order_total' => 'getOrderTotal',
        'number_of_items_shipped' => 'getNumberOfItemsShipped',
        'number_of_items_unshipped' => 'getNumberOfItemsUnshipped',
        'payment_execution_detail' => 'getPaymentExecutionDetail',
        'payment_method' => 'getPaymentMethod',
        'payment_method_details' => 'getPaymentMethodDetails',
        'marketplace_id' => 'getMarketplaceId',
        'shipment_service_level_category' => 'getShipmentServiceLevelCategory',
        'easy_ship_shipment_status' => 'getEasyShipShipmentStatus',
        'cba_displayable_shipping_label' => 'getCbaDisplayableShippingLabel',
        'order_type' => 'getOrderType',
        'earliest_ship_date' => 'getEarliestShipDate',
        'latest_ship_date' => 'getLatestShipDate',
        'earliest_delivery_date' => 'getEarliestDeliveryDate',
        'latest_delivery_date' => 'getLatestDeliveryDate',
        'is_business_order' => 'getIsBusinessOrder',
        'is_prime' => 'getIsPrime',
        'is_premium_order' => 'getIsPremiumOrder',
        'is_global_express_enabled' => 'getIsGlobalExpressEnabled',
        'replaced_order_id' => 'getReplacedOrderId',
        'is_replacement_order' => 'getIsReplacementOrder',
        'promise_response_due_date' => 'getPromiseResponseDueDate',
        'is_estimated_ship_date_set' => 'getIsEstimatedShipDateSet',
        'is_sold_by_ab' => 'getIsSoldByAb',
        'is_iba' => 'getIsIba',
        'default_ship_from_location_address' => 'getDefaultShipFromLocationAddress',
        'buyer_invoice_preference' => 'getBuyerInvoicePreference',
        'buyer_tax_information' => 'getBuyerTaxInformation',
        'fulfillment_instruction' => 'getFulfillmentInstruction',
        'is_ispu' => 'getIsIspu',
        'is_access_point_order' => 'getIsAccessPointOrder',
        'marketplace_tax_info' => 'getMarketplaceTaxInfo',
        'seller_display_name' => 'getSellerDisplayName',
        'shipping_address' => 'getShippingAddress',
        'buyer_info' => 'getBuyerInfo',
        'automated_shipping_settings' => 'getAutomatedShippingSettings',
        'has_regulated_items' => 'getHasRegulatedItems',
        'electronic_invoice_status' => 'getElectronicInvoiceStatus',
    ];

    /**
     * Associative array for storing property values.
     */
    protected array $container = [];

    /**
     * Constructor.
     *
     * @param null|array $data Associated array of property values
     *                         initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('amazon_order_id', $data ?? [], null);
        $this->setIfExists('seller_order_id', $data ?? [], null);
        $this->setIfExists('purchase_date', $data ?? [], null);
        $this->setIfExists('last_update_date', $data ?? [], null);
        $this->setIfExists('order_status', $data ?? [], null);
        $this->setIfExists('fulfillment_channel', $data ?? [], null);
        $this->setIfExists('sales_channel', $data ?? [], null);
        $this->setIfExists('order_channel', $data ?? [], null);
        $this->setIfExists('ship_service_level', $data ?? [], null);
        $this->setIfExists('order_total', $data ?? [], null);
        $this->setIfExists('number_of_items_shipped', $data ?? [], null);
        $this->setIfExists('number_of_items_unshipped', $data ?? [], null);
        $this->setIfExists('payment_execution_detail', $data ?? [], null);
        $this->setIfExists('payment_method', $data ?? [], null);
        $this->setIfExists('payment_method_details', $data ?? [], null);
        $this->setIfExists('marketplace_id', $data ?? [], null);
        $this->setIfExists('shipment_service_level_category', $data ?? [], null);
        $this->setIfExists('easy_ship_shipment_status', $data ?? [], null);
        $this->setIfExists('cba_displayable_shipping_label', $data ?? [], null);
        $this->setIfExists('order_type', $data ?? [], null);
        $this->setIfExists('earliest_ship_date', $data ?? [], null);
        $this->setIfExists('latest_ship_date', $data ?? [], null);
        $this->setIfExists('earliest_delivery_date', $data ?? [], null);
        $this->setIfExists('latest_delivery_date', $data ?? [], null);
        $this->setIfExists('is_business_order', $data ?? [], null);
        $this->setIfExists('is_prime', $data ?? [], null);
        $this->setIfExists('is_premium_order', $data ?? [], null);
        $this->setIfExists('is_global_express_enabled', $data ?? [], null);
        $this->setIfExists('replaced_order_id', $data ?? [], null);
        $this->setIfExists('is_replacement_order', $data ?? [], null);
        $this->setIfExists('promise_response_due_date', $data ?? [], null);
        $this->setIfExists('is_estimated_ship_date_set', $data ?? [], null);
        $this->setIfExists('is_sold_by_ab', $data ?? [], null);
        $this->setIfExists('is_iba', $data ?? [], null);
        $this->setIfExists('default_ship_from_location_address', $data ?? [], null);
        $this->setIfExists('buyer_invoice_preference', $data ?? [], null);
        $this->setIfExists('buyer_tax_information', $data ?? [], null);
        $this->setIfExists('fulfillment_instruction', $data ?? [], null);
        $this->setIfExists('is_ispu', $data ?? [], null);
        $this->setIfExists('is_access_point_order', $data ?? [], null);
        $this->setIfExists('marketplace_tax_info', $data ?? [], null);
        $this->setIfExists('seller_display_name', $data ?? [], null);
        $this->setIfExists('shipping_address', $data ?? [], null);
        $this->setIfExists('buyer_info', $data ?? [], null);
        $this->setIfExists('automated_shipping_settings', $data ?? [], null);
        $this->setIfExists('has_regulated_items', $data ?? [], null);
        $this->setIfExists('electronic_invoice_status', $data ?? [], null);
    }

    /**
     * Gets the string presentation of the object.
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Array of property to type mappings. Used for (de)serialization.
     */
    public static function openAPITypes(): array
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization.
     */
    public static function openAPIFormats(): array
    {
        return self::$openAPIFormats;
    }

    /**
     * Checks if a property is nullable.
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     */
    public static function attributeMap(): array
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     */
    public static function setters(): array
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests).
     */
    public static function getters(): array
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     */
    public function getModelName(): string
    {
        return self::$openAPIModelName;
    }

    /**
     * Gets allowable values of the enum.
     *
     * @return string[]
     */
    public function getOrderStatusAllowableValues(): array
    {
        return [
            self::ORDER_STATUS_PENDING,
            self::ORDER_STATUS_UNSHIPPED,
            self::ORDER_STATUS_PARTIALLY_SHIPPED,
            self::ORDER_STATUS_SHIPPED,
            self::ORDER_STATUS_CANCELED,
            self::ORDER_STATUS_UNFULFILLABLE,
            self::ORDER_STATUS_INVOICE_UNCONFIRMED,
            self::ORDER_STATUS_PENDING_AVAILABILITY,
        ];
    }

    /**
     * Gets allowable values of the enum.
     *
     * @return string[]
     */
    public function getFulfillmentChannelAllowableValues(): array
    {
        return [
            self::FULFILLMENT_CHANNEL_MFN,
            self::FULFILLMENT_CHANNEL_AFN,
        ];
    }

    /**
     * Gets allowable values of the enum.
     *
     * @return string[]
     */
    public function getPaymentMethodAllowableValues(): array
    {
        return [
            self::PAYMENT_METHOD_COD,
            self::PAYMENT_METHOD_CVS,
            self::PAYMENT_METHOD_OTHER,
        ];
    }

    /**
     * Gets allowable values of the enum.
     *
     * @return string[]
     */
    public function getOrderTypeAllowableValues(): array
    {
        return [
            self::ORDER_TYPE_STANDARD_ORDER,
            self::ORDER_TYPE_LONG_LEAD_TIME_ORDER,
            self::ORDER_TYPE_PREORDER,
            self::ORDER_TYPE_BACK_ORDER,
            self::ORDER_TYPE_SOURCING_ON_DEMAND_ORDER,
        ];
    }

    /**
     * Gets allowable values of the enum.
     *
     * @return string[]
     */
    public function getBuyerInvoicePreferenceAllowableValues(): array
    {
        return [
            self::BUYER_INVOICE_PREFERENCE_INDIVIDUAL,
            self::BUYER_INVOICE_PREFERENCE_BUSINESS,
        ];
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties(): array
    {
        $invalidProperties = [];

        if (null === $this->container['amazon_order_id']) {
            $invalidProperties[] = "'amazon_order_id' can't be null";
        }
        if (null === $this->container['purchase_date']) {
            $invalidProperties[] = "'purchase_date' can't be null";
        }
        if (null === $this->container['last_update_date']) {
            $invalidProperties[] = "'last_update_date' can't be null";
        }
        if (null === $this->container['order_status']) {
            $invalidProperties[] = "'order_status' can't be null";
        }
        $allowedValues = $this->getOrderStatusAllowableValues();
        if (!is_null($this->container['order_status']) && !in_array($this->container['order_status'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'order_status', must be one of '%s'",
                $this->container['order_status'],
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getFulfillmentChannelAllowableValues();
        if (!is_null($this->container['fulfillment_channel']) && !in_array($this->container['fulfillment_channel'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'fulfillment_channel', must be one of '%s'",
                $this->container['fulfillment_channel'],
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getPaymentMethodAllowableValues();
        if (!is_null($this->container['payment_method']) && !in_array($this->container['payment_method'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'payment_method', must be one of '%s'",
                $this->container['payment_method'],
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getOrderTypeAllowableValues();
        if (!is_null($this->container['order_type']) && !in_array($this->container['order_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'order_type', must be one of '%s'",
                $this->container['order_type'],
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getBuyerInvoicePreferenceAllowableValues();
        if (!is_null($this->container['buyer_invoice_preference']) && !in_array($this->container['buyer_invoice_preference'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'buyer_invoice_preference', must be one of '%s'",
                $this->container['buyer_invoice_preference'],
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed.
     *
     * @return bool True if all properties are valid
     */
    public function valid(): bool
    {
        return 0 === count($this->listInvalidProperties());
    }

    /**
     * Gets amazon_order_id.
     */
    public function getAmazonOrderId(): string
    {
        return $this->container['amazon_order_id'];
    }

    /**
     * Sets amazon_order_id.
     *
     * @param string $amazon_order_id an Amazon-defined order identifier, in 3-7-7 format
     */
    public function setAmazonOrderId(string $amazon_order_id): self
    {
        if (is_null($amazon_order_id)) {
            throw new \InvalidArgumentException('non-nullable amazon_order_id cannot be null');
        }
        $this->container['amazon_order_id'] = $amazon_order_id;

        return $this;
    }

    /**
     * Gets seller_order_id.
     */
    public function getSellerOrderId(): ?string
    {
        return $this->container['seller_order_id'];
    }

    /**
     * Sets seller_order_id.
     *
     * @param null|string $seller_order_id a seller-defined order identifier
     */
    public function setSellerOrderId(?string $seller_order_id): self
    {
        if (is_null($seller_order_id)) {
            array_push($this->openAPINullablesSetToNull, 'seller_order_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('seller_order_id', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['seller_order_id'] = $seller_order_id;

        return $this;
    }

    /**
     * Gets purchase_date.
     */
    public function getPurchaseDate(): string
    {
        return $this->container['purchase_date'];
    }

    /**
     * Sets purchase_date.
     *
     * @param string $purchase_date the date when the order was created
     */
    public function setPurchaseDate(string $purchase_date): self
    {
        if (is_null($purchase_date)) {
            throw new \InvalidArgumentException('non-nullable purchase_date cannot be null');
        }
        $this->container['purchase_date'] = $purchase_date;

        return $this;
    }

    /**
     * Gets last_update_date.
     */
    public function getLastUpdateDate(): string
    {
        return $this->container['last_update_date'];
    }

    /**
     * Sets last_update_date.
     *
     * @param string $last_update_date The date when the order was last updated.  __Note__: `LastUpdateDate` is returned with an incorrect date for orders that were last updated before 2009-04-01.
     */
    public function setLastUpdateDate(string $last_update_date): self
    {
        if (is_null($last_update_date)) {
            throw new \InvalidArgumentException('non-nullable last_update_date cannot be null');
        }
        $this->container['last_update_date'] = $last_update_date;

        return $this;
    }

    /**
     * Gets order_status.
     */
    public function getOrderStatus(): string
    {
        return $this->container['order_status'];
    }

    /**
     * Sets order_status.
     *
     * @param string $order_status the current order status
     */
    public function setOrderStatus(string $order_status): self
    {
        if (is_null($order_status)) {
            throw new \InvalidArgumentException('non-nullable order_status cannot be null');
        }
        $allowedValues = $this->getOrderStatusAllowableValues();
        if (!in_array($order_status, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'order_status', must be one of '%s'",
                    $order_status,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['order_status'] = $order_status;

        return $this;
    }

    /**
     * Gets fulfillment_channel.
     */
    public function getFulfillmentChannel(): ?string
    {
        return $this->container['fulfillment_channel'];
    }

    /**
     * Sets fulfillment_channel.
     *
     * @param null|string $fulfillment_channel whether the order was fulfilled by Amazon (`AFN`) or by the seller (`MFN`)
     */
    public function setFulfillmentChannel(?string $fulfillment_channel): self
    {
        if (is_null($fulfillment_channel)) {
            array_push($this->openAPINullablesSetToNull, 'fulfillment_channel');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('fulfillment_channel', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $allowedValues = $this->getFulfillmentChannelAllowableValues();
        if (!is_null($fulfillment_channel) && !in_array($fulfillment_channel, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'fulfillment_channel', must be one of '%s'",
                    $fulfillment_channel,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['fulfillment_channel'] = $fulfillment_channel;

        return $this;
    }

    /**
     * Gets sales_channel.
     */
    public function getSalesChannel(): ?string
    {
        return $this->container['sales_channel'];
    }

    /**
     * Sets sales_channel.
     *
     * @param null|string $sales_channel the sales channel for the first item in the order
     */
    public function setSalesChannel(?string $sales_channel): self
    {
        if (is_null($sales_channel)) {
            array_push($this->openAPINullablesSetToNull, 'sales_channel');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('sales_channel', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['sales_channel'] = $sales_channel;

        return $this;
    }

    /**
     * Gets order_channel.
     */
    public function getOrderChannel(): ?string
    {
        return $this->container['order_channel'];
    }

    /**
     * Sets order_channel.
     *
     * @param null|string $order_channel the order channel for the first item in the order
     */
    public function setOrderChannel(?string $order_channel): self
    {
        if (is_null($order_channel)) {
            array_push($this->openAPINullablesSetToNull, 'order_channel');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('order_channel', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['order_channel'] = $order_channel;

        return $this;
    }

    /**
     * Gets ship_service_level.
     */
    public function getShipServiceLevel(): ?string
    {
        return $this->container['ship_service_level'];
    }

    /**
     * Sets ship_service_level.
     *
     * @param null|string $ship_service_level the order's shipment service level
     */
    public function setShipServiceLevel(?string $ship_service_level): self
    {
        if (is_null($ship_service_level)) {
            array_push($this->openAPINullablesSetToNull, 'ship_service_level');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('ship_service_level', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['ship_service_level'] = $ship_service_level;

        return $this;
    }

    /**
     * Gets order_total.
     */
    public function getOrderTotal(): ?Money
    {
        return $this->container['order_total'];
    }

    /**
     * Sets order_total.
     *
     * @param null|Money $order_total order_total
     */
    public function setOrderTotal(?Money $order_total): self
    {
        if (is_null($order_total)) {
            array_push($this->openAPINullablesSetToNull, 'order_total');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('order_total', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['order_total'] = $order_total;

        return $this;
    }

    /**
     * Gets number_of_items_shipped.
     */
    public function getNumberOfItemsShipped(): ?int
    {
        return $this->container['number_of_items_shipped'];
    }

    /**
     * Sets number_of_items_shipped.
     *
     * @param null|int $number_of_items_shipped the number of items shipped
     */
    public function setNumberOfItemsShipped(?int $number_of_items_shipped): self
    {
        if (is_null($number_of_items_shipped)) {
            array_push($this->openAPINullablesSetToNull, 'number_of_items_shipped');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('number_of_items_shipped', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['number_of_items_shipped'] = $number_of_items_shipped;

        return $this;
    }

    /**
     * Gets number_of_items_unshipped.
     */
    public function getNumberOfItemsUnshipped(): ?int
    {
        return $this->container['number_of_items_unshipped'];
    }

    /**
     * Sets number_of_items_unshipped.
     *
     * @param null|int $number_of_items_unshipped the number of items unshipped
     */
    public function setNumberOfItemsUnshipped(?int $number_of_items_unshipped): self
    {
        if (is_null($number_of_items_unshipped)) {
            array_push($this->openAPINullablesSetToNull, 'number_of_items_unshipped');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('number_of_items_unshipped', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['number_of_items_unshipped'] = $number_of_items_unshipped;

        return $this;
    }

    /**
     * Gets payment_execution_detail.
     */
    public function getPaymentExecutionDetail(): ?array
    {
        return $this->container['payment_execution_detail'];
    }

    /**
     * Sets payment_execution_detail.
     *
     * @param null|array $payment_execution_detail a list of payment execution detail items
     */
    public function setPaymentExecutionDetail(?array $payment_execution_detail): self
    {
        if (is_null($payment_execution_detail)) {
            array_push($this->openAPINullablesSetToNull, 'payment_execution_detail');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('payment_execution_detail', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['payment_execution_detail'] = $payment_execution_detail;

        return $this;
    }

    /**
     * Gets payment_method.
     */
    public function getPaymentMethod(): ?string
    {
        return $this->container['payment_method'];
    }

    /**
     * Sets payment_method.
     *
     * @param null|string $payment_method The payment method for the order. This property is limited to COD and CVS payment methods. Unless you need the specific COD payment information provided by the `PaymentExecutionDetailItem` object, we recommend using the `PaymentMethodDetails` property to get payment method information.
     */
    public function setPaymentMethod(?string $payment_method): self
    {
        if (is_null($payment_method)) {
            array_push($this->openAPINullablesSetToNull, 'payment_method');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('payment_method', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $allowedValues = $this->getPaymentMethodAllowableValues();
        if (!is_null($payment_method) && !in_array($payment_method, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'payment_method', must be one of '%s'",
                    $payment_method,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['payment_method'] = $payment_method;

        return $this;
    }

    /**
     * Gets payment_method_details.
     */
    public function getPaymentMethodDetails(): ?array
    {
        return $this->container['payment_method_details'];
    }

    /**
     * Sets payment_method_details.
     *
     * @param null|array $payment_method_details a list of payment method detail items
     */
    public function setPaymentMethodDetails(?array $payment_method_details): self
    {
        if (is_null($payment_method_details)) {
            array_push($this->openAPINullablesSetToNull, 'payment_method_details');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('payment_method_details', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['payment_method_details'] = $payment_method_details;

        return $this;
    }

    /**
     * Gets marketplace_id.
     */
    public function getMarketplaceId(): ?string
    {
        return $this->container['marketplace_id'];
    }

    /**
     * Sets marketplace_id.
     *
     * @param null|string $marketplace_id the identifier for the marketplace where the order was placed
     */
    public function setMarketplaceId(?string $marketplace_id): self
    {
        if (is_null($marketplace_id)) {
            array_push($this->openAPINullablesSetToNull, 'marketplace_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('marketplace_id', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['marketplace_id'] = $marketplace_id;

        return $this;
    }

    /**
     * Gets shipment_service_level_category.
     */
    public function getShipmentServiceLevelCategory(): ?string
    {
        return $this->container['shipment_service_level_category'];
    }

    /**
     * Sets shipment_service_level_category.
     *
     * @param null|string $shipment_service_level_category The shipment service level category for the order.  **Possible values**: `Expedited`, `FreeEconomy`, `NextDay`, `Priority`, `SameDay`, `SecondDay`, `Scheduled`, and `Standard`.
     */
    public function setShipmentServiceLevelCategory(?string $shipment_service_level_category): self
    {
        if (is_null($shipment_service_level_category)) {
            array_push($this->openAPINullablesSetToNull, 'shipment_service_level_category');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipment_service_level_category', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['shipment_service_level_category'] = $shipment_service_level_category;

        return $this;
    }

    /**
     * Gets easy_ship_shipment_status.
     */
    public function getEasyShipShipmentStatus(): ?string
    {
        return $this->container['easy_ship_shipment_status'];
    }

    /**
     * Sets easy_ship_shipment_status.
     *
     * @param null|string $easy_ship_shipment_status easy_ship_shipment_status
     */
    public function setEasyShipShipmentStatus(?string $easy_ship_shipment_status): self
    {
        if (is_null($easy_ship_shipment_status)) {
            array_push($this->openAPINullablesSetToNull, 'easy_ship_shipment_status');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('easy_ship_shipment_status', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['easy_ship_shipment_status'] = $easy_ship_shipment_status;

        return $this;
    }

    /**
     * Gets cba_displayable_shipping_label.
     */
    public function getCbaDisplayableShippingLabel(): ?string
    {
        return $this->container['cba_displayable_shipping_label'];
    }

    /**
     * Sets cba_displayable_shipping_label.
     *
     * @param null|string $cba_displayable_shipping_label custom ship label for Checkout by Amazon (CBA)
     */
    public function setCbaDisplayableShippingLabel(?string $cba_displayable_shipping_label): self
    {
        if (is_null($cba_displayable_shipping_label)) {
            array_push($this->openAPINullablesSetToNull, 'cba_displayable_shipping_label');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('cba_displayable_shipping_label', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['cba_displayable_shipping_label'] = $cba_displayable_shipping_label;

        return $this;
    }

    /**
     * Gets order_type.
     */
    public function getOrderType(): ?string
    {
        return $this->container['order_type'];
    }

    /**
     * Sets order_type.
     *
     * @param null|string $order_type the order's type
     */
    public function setOrderType(?string $order_type): self
    {
        if (is_null($order_type)) {
            array_push($this->openAPINullablesSetToNull, 'order_type');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('order_type', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $allowedValues = $this->getOrderTypeAllowableValues();
        if (!is_null($order_type) && !in_array($order_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'order_type', must be one of '%s'",
                    $order_type,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['order_type'] = $order_type;

        return $this;
    }

    /**
     * Gets earliest_ship_date.
     */
    public function getEarliestShipDate(): ?string
    {
        return $this->container['earliest_ship_date'];
    }

    /**
     * Sets earliest_ship_date.
     *
     * @param null|string $earliest_ship_date The start of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: `EarliestShipDate` might not be returned for orders placed before February 1, 2013.
     */
    public function setEarliestShipDate(?string $earliest_ship_date): self
    {
        if (is_null($earliest_ship_date)) {
            array_push($this->openAPINullablesSetToNull, 'earliest_ship_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('earliest_ship_date', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['earliest_ship_date'] = $earliest_ship_date;

        return $this;
    }

    /**
     * Gets latest_ship_date.
     */
    public function getLatestShipDate(): ?string
    {
        return $this->container['latest_ship_date'];
    }

    /**
     * Sets latest_ship_date.
     *
     * @param null|string $latest_ship_date The end of the time period within which you have committed to ship the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.  __Note__: `LatestShipDate` might not be returned for orders placed before February 1, 2013.
     */
    public function setLatestShipDate(?string $latest_ship_date): self
    {
        if (is_null($latest_ship_date)) {
            array_push($this->openAPINullablesSetToNull, 'latest_ship_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('latest_ship_date', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['latest_ship_date'] = $latest_ship_date;

        return $this;
    }

    /**
     * Gets earliest_delivery_date.
     */
    public function getEarliestDeliveryDate(): ?string
    {
        return $this->container['earliest_delivery_date'];
    }

    /**
     * Sets earliest_delivery_date.
     *
     * @param null|string $earliest_delivery_date The start of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders.
     */
    public function setEarliestDeliveryDate(?string $earliest_delivery_date): self
    {
        if (is_null($earliest_delivery_date)) {
            array_push($this->openAPINullablesSetToNull, 'earliest_delivery_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('earliest_delivery_date', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['earliest_delivery_date'] = $earliest_delivery_date;

        return $this;
    }

    /**
     * Gets latest_delivery_date.
     */
    public function getLatestDeliveryDate(): ?string
    {
        return $this->container['latest_delivery_date'];
    }

    /**
     * Sets latest_delivery_date.
     *
     * @param null|string $latest_delivery_date The end of the time period within which you have committed to fulfill the order. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date time format. Only returned for seller-fulfilled orders that do not have a `PendingAvailability`, `Pending`, or `Canceled` status.
     */
    public function setLatestDeliveryDate(?string $latest_delivery_date): self
    {
        if (is_null($latest_delivery_date)) {
            array_push($this->openAPINullablesSetToNull, 'latest_delivery_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('latest_delivery_date', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['latest_delivery_date'] = $latest_delivery_date;

        return $this;
    }

    /**
     * Gets is_business_order.
     */
    public function getIsBusinessOrder(): ?bool
    {
        return $this->container['is_business_order'];
    }

    /**
     * Sets is_business_order.
     *
     * @param null|bool $is_business_order When true, the order is an Amazon Business order. An Amazon Business order is an order where the buyer is a Verified Business Buyer.
     */
    public function setIsBusinessOrder(?bool $is_business_order): self
    {
        if (is_null($is_business_order)) {
            array_push($this->openAPINullablesSetToNull, 'is_business_order');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_business_order', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_business_order'] = $is_business_order;

        return $this;
    }

    /**
     * Gets is_prime.
     */
    public function getIsPrime(): ?bool
    {
        return $this->container['is_prime'];
    }

    /**
     * Sets is_prime.
     *
     * @param null|bool $is_prime when true, the order is a seller-fulfilled Amazon Prime order
     */
    public function setIsPrime(?bool $is_prime): self
    {
        if (is_null($is_prime)) {
            array_push($this->openAPINullablesSetToNull, 'is_prime');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_prime', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_prime'] = $is_prime;

        return $this;
    }

    /**
     * Gets is_premium_order.
     */
    public function getIsPremiumOrder(): ?bool
    {
        return $this->container['is_premium_order'];
    }

    /**
     * Sets is_premium_order.
     *
     * @param null|bool $is_premium_order When true, the order has a Premium Shipping Service Level Agreement. For more information about Premium Shipping orders, refer to \"Premium Shipping Options\" in the Seller Central Help for your marketplace.
     */
    public function setIsPremiumOrder(?bool $is_premium_order): self
    {
        if (is_null($is_premium_order)) {
            array_push($this->openAPINullablesSetToNull, 'is_premium_order');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_premium_order', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_premium_order'] = $is_premium_order;

        return $this;
    }

    /**
     * Gets is_global_express_enabled.
     */
    public function getIsGlobalExpressEnabled(): ?bool
    {
        return $this->container['is_global_express_enabled'];
    }

    /**
     * Sets is_global_express_enabled.
     *
     * @param null|bool $is_global_express_enabled when true, the order is a `GlobalExpress` order
     */
    public function setIsGlobalExpressEnabled(?bool $is_global_express_enabled): self
    {
        if (is_null($is_global_express_enabled)) {
            array_push($this->openAPINullablesSetToNull, 'is_global_express_enabled');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_global_express_enabled', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_global_express_enabled'] = $is_global_express_enabled;

        return $this;
    }

    /**
     * Gets replaced_order_id.
     */
    public function getReplacedOrderId(): ?string
    {
        return $this->container['replaced_order_id'];
    }

    /**
     * Sets replaced_order_id.
     *
     * @param null|string $replaced_order_id The order ID value for the order that is being replaced. Returned only if IsReplacementOrder = true.
     */
    public function setReplacedOrderId(?string $replaced_order_id): self
    {
        if (is_null($replaced_order_id)) {
            array_push($this->openAPINullablesSetToNull, 'replaced_order_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('replaced_order_id', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['replaced_order_id'] = $replaced_order_id;

        return $this;
    }

    /**
     * Gets is_replacement_order.
     */
    public function getIsReplacementOrder(): ?bool
    {
        return $this->container['is_replacement_order'];
    }

    /**
     * Sets is_replacement_order.
     *
     * @param null|bool $is_replacement_order when true, this is a replacement order
     */
    public function setIsReplacementOrder(?bool $is_replacement_order): self
    {
        if (is_null($is_replacement_order)) {
            array_push($this->openAPINullablesSetToNull, 'is_replacement_order');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_replacement_order', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_replacement_order'] = $is_replacement_order;

        return $this;
    }

    /**
     * Gets promise_response_due_date.
     */
    public function getPromiseResponseDueDate(): ?string
    {
        return $this->container['promise_response_due_date'];
    }

    /**
     * Sets promise_response_due_date.
     *
     * @param null|string $promise_response_due_date Indicates the date by which the seller must respond to the buyer with an estimated ship date. Only returned for Sourcing on Demand orders.
     */
    public function setPromiseResponseDueDate(?string $promise_response_due_date): self
    {
        if (is_null($promise_response_due_date)) {
            array_push($this->openAPINullablesSetToNull, 'promise_response_due_date');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('promise_response_due_date', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['promise_response_due_date'] = $promise_response_due_date;

        return $this;
    }

    /**
     * Gets is_estimated_ship_date_set.
     */
    public function getIsEstimatedShipDateSet(): ?bool
    {
        return $this->container['is_estimated_ship_date_set'];
    }

    /**
     * Sets is_estimated_ship_date_set.
     *
     * @param null|bool $is_estimated_ship_date_set When true, the estimated ship date is set for the order. Only returned for Sourcing on Demand orders.
     */
    public function setIsEstimatedShipDateSet(?bool $is_estimated_ship_date_set): self
    {
        if (is_null($is_estimated_ship_date_set)) {
            array_push($this->openAPINullablesSetToNull, 'is_estimated_ship_date_set');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_estimated_ship_date_set', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_estimated_ship_date_set'] = $is_estimated_ship_date_set;

        return $this;
    }

    /**
     * Gets is_sold_by_ab.
     */
    public function getIsSoldByAb(): ?bool
    {
        return $this->container['is_sold_by_ab'];
    }

    /**
     * Sets is_sold_by_ab.
     *
     * @param null|bool $is_sold_by_ab When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.
     */
    public function setIsSoldByAb(?bool $is_sold_by_ab): self
    {
        if (is_null($is_sold_by_ab)) {
            array_push($this->openAPINullablesSetToNull, 'is_sold_by_ab');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_sold_by_ab', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_sold_by_ab'] = $is_sold_by_ab;

        return $this;
    }

    /**
     * Gets is_iba.
     */
    public function getIsIba(): ?bool
    {
        return $this->container['is_iba'];
    }

    /**
     * Sets is_iba.
     *
     * @param null|bool $is_iba When true, the item within this order was bought and re-sold by Amazon Business EU SARL (ABEU). By buying and instantly re-selling your items, ABEU becomes the seller of record, making your inventory available for sale to customers who would not otherwise purchase from a third-party seller.
     */
    public function setIsIba(?bool $is_iba): self
    {
        if (is_null($is_iba)) {
            array_push($this->openAPINullablesSetToNull, 'is_iba');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_iba', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_iba'] = $is_iba;

        return $this;
    }

    /**
     * Gets default_ship_from_location_address.
     */
    public function getDefaultShipFromLocationAddress(): ?Address
    {
        return $this->container['default_ship_from_location_address'];
    }

    /**
     * Sets default_ship_from_location_address.
     *
     * @param null|Address $default_ship_from_location_address default_ship_from_location_address
     */
    public function setDefaultShipFromLocationAddress(?Address $default_ship_from_location_address): self
    {
        if (is_null($default_ship_from_location_address)) {
            array_push($this->openAPINullablesSetToNull, 'default_ship_from_location_address');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('default_ship_from_location_address', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['default_ship_from_location_address'] = $default_ship_from_location_address;

        return $this;
    }

    /**
     * Gets buyer_invoice_preference.
     */
    public function getBuyerInvoicePreference(): ?string
    {
        return $this->container['buyer_invoice_preference'];
    }

    /**
     * Sets buyer_invoice_preference.
     *
     * @param null|string $buyer_invoice_preference The buyer's invoicing preference. Sellers can use this data to issue electronic invoices for orders in Turkey.  **Note**: This attribute is only available in the Turkey marketplace.
     */
    public function setBuyerInvoicePreference(?string $buyer_invoice_preference): self
    {
        if (is_null($buyer_invoice_preference)) {
            array_push($this->openAPINullablesSetToNull, 'buyer_invoice_preference');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('buyer_invoice_preference', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $allowedValues = $this->getBuyerInvoicePreferenceAllowableValues();
        if (!is_null($buyer_invoice_preference) && !in_array($buyer_invoice_preference, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'buyer_invoice_preference', must be one of '%s'",
                    $buyer_invoice_preference,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['buyer_invoice_preference'] = $buyer_invoice_preference;

        return $this;
    }

    /**
     * Gets buyer_tax_information.
     */
    public function getBuyerTaxInformation(): ?BuyerTaxInformation
    {
        return $this->container['buyer_tax_information'];
    }

    /**
     * Sets buyer_tax_information.
     *
     * @param null|BuyerTaxInformation $buyer_tax_information buyer_tax_information
     */
    public function setBuyerTaxInformation(?BuyerTaxInformation $buyer_tax_information): self
    {
        if (is_null($buyer_tax_information)) {
            array_push($this->openAPINullablesSetToNull, 'buyer_tax_information');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('buyer_tax_information', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['buyer_tax_information'] = $buyer_tax_information;

        return $this;
    }

    /**
     * Gets fulfillment_instruction.
     */
    public function getFulfillmentInstruction(): ?FulfillmentInstruction
    {
        return $this->container['fulfillment_instruction'];
    }

    /**
     * Sets fulfillment_instruction.
     *
     * @param null|FulfillmentInstruction $fulfillment_instruction fulfillment_instruction
     */
    public function setFulfillmentInstruction(?FulfillmentInstruction $fulfillment_instruction): self
    {
        if (is_null($fulfillment_instruction)) {
            array_push($this->openAPINullablesSetToNull, 'fulfillment_instruction');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('fulfillment_instruction', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['fulfillment_instruction'] = $fulfillment_instruction;

        return $this;
    }

    /**
     * Gets is_ispu.
     */
    public function getIsIspu(): ?bool
    {
        return $this->container['is_ispu'];
    }

    /**
     * Sets is_ispu.
     *
     * @param null|bool $is_ispu when true, this order is marked to be picked up from a store rather than delivered
     */
    public function setIsIspu(?bool $is_ispu): self
    {
        if (is_null($is_ispu)) {
            array_push($this->openAPINullablesSetToNull, 'is_ispu');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_ispu', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_ispu'] = $is_ispu;

        return $this;
    }

    /**
     * Gets is_access_point_order.
     */
    public function getIsAccessPointOrder(): ?bool
    {
        return $this->container['is_access_point_order'];
    }

    /**
     * Sets is_access_point_order.
     *
     * @param null|bool $is_access_point_order When true, this order is marked to be delivered to an Access Point. The access location is chosen by the customer. Access Points include Amazon Hub Lockers, Amazon Hub Counters, and pickup points operated by carriers.
     */
    public function setIsAccessPointOrder(?bool $is_access_point_order): self
    {
        if (is_null($is_access_point_order)) {
            array_push($this->openAPINullablesSetToNull, 'is_access_point_order');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('is_access_point_order', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['is_access_point_order'] = $is_access_point_order;

        return $this;
    }

    /**
     * Gets marketplace_tax_info.
     */
    public function getMarketplaceTaxInfo(): ?MarketplaceTaxInfo
    {
        return $this->container['marketplace_tax_info'];
    }

    /**
     * Sets marketplace_tax_info.
     *
     * @param null|MarketplaceTaxInfo $marketplace_tax_info marketplace_tax_info
     */
    public function setMarketplaceTaxInfo(?MarketplaceTaxInfo $marketplace_tax_info): self
    {
        if (is_null($marketplace_tax_info)) {
            array_push($this->openAPINullablesSetToNull, 'marketplace_tax_info');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('marketplace_tax_info', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['marketplace_tax_info'] = $marketplace_tax_info;

        return $this;
    }

    /**
     * Gets seller_display_name.
     */
    public function getSellerDisplayName(): ?string
    {
        return $this->container['seller_display_name'];
    }

    /**
     * Sets seller_display_name.
     *
     * @param null|string $seller_display_name The seller’s friendly name registered in the marketplace where the sale took place. Sellers can use this data to issue electronic invoices for orders in Brazil.  **Note**: This attribute is only available in the Brazil marketplace for the orders with `Pending` or `Unshipped` status.
     */
    public function setSellerDisplayName(?string $seller_display_name): self
    {
        if (is_null($seller_display_name)) {
            array_push($this->openAPINullablesSetToNull, 'seller_display_name');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('seller_display_name', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['seller_display_name'] = $seller_display_name;

        return $this;
    }

    /**
     * Gets shipping_address.
     */
    public function getShippingAddress(): ?Address
    {
        return $this->container['shipping_address'];
    }

    /**
     * Sets shipping_address.
     *
     * @param null|Address $shipping_address shipping_address
     */
    public function setShippingAddress(?Address $shipping_address): self
    {
        if (is_null($shipping_address)) {
            array_push($this->openAPINullablesSetToNull, 'shipping_address');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('shipping_address', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['shipping_address'] = $shipping_address;

        return $this;
    }

    /**
     * Gets buyer_info.
     */
    public function getBuyerInfo(): ?BuyerInfo
    {
        return $this->container['buyer_info'];
    }

    /**
     * Sets buyer_info.
     *
     * @param null|BuyerInfo $buyer_info buyer_info
     */
    public function setBuyerInfo(?BuyerInfo $buyer_info): self
    {
        if (is_null($buyer_info)) {
            array_push($this->openAPINullablesSetToNull, 'buyer_info');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('buyer_info', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['buyer_info'] = $buyer_info;

        return $this;
    }

    /**
     * Gets automated_shipping_settings.
     */
    public function getAutomatedShippingSettings(): ?AutomatedShippingSettings
    {
        return $this->container['automated_shipping_settings'];
    }

    /**
     * Sets automated_shipping_settings.
     *
     * @param null|AutomatedShippingSettings $automated_shipping_settings automated_shipping_settings
     */
    public function setAutomatedShippingSettings(?AutomatedShippingSettings $automated_shipping_settings): self
    {
        if (is_null($automated_shipping_settings)) {
            array_push($this->openAPINullablesSetToNull, 'automated_shipping_settings');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('automated_shipping_settings', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['automated_shipping_settings'] = $automated_shipping_settings;

        return $this;
    }

    /**
     * Gets has_regulated_items.
     */
    public function getHasRegulatedItems(): ?bool
    {
        return $this->container['has_regulated_items'];
    }

    /**
     * Sets has_regulated_items.
     *
     * @param null|bool $has_regulated_items whether the order contains regulated items which may require additional approval steps before being fulfilled
     */
    public function setHasRegulatedItems(?bool $has_regulated_items): self
    {
        if (is_null($has_regulated_items)) {
            array_push($this->openAPINullablesSetToNull, 'has_regulated_items');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('has_regulated_items', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['has_regulated_items'] = $has_regulated_items;

        return $this;
    }

    /**
     * Gets electronic_invoice_status.
     */
    public function getElectronicInvoiceStatus(): ?string
    {
        return $this->container['electronic_invoice_status'];
    }

    /**
     * Sets electronic_invoice_status.
     *
     * @param null|string $electronic_invoice_status electronic_invoice_status
     */
    public function setElectronicInvoiceStatus(?string $electronic_invoice_status): self
    {
        if (is_null($electronic_invoice_status)) {
            array_push($this->openAPINullablesSetToNull, 'electronic_invoice_status');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('electronic_invoice_status', $nullablesSetToNull);
            if (false !== $index) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['electronic_invoice_status'] = $electronic_invoice_status;

        return $this;
    }

    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param int $offset Offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param int $offset Offset
     *
     * @return null|mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset): mixed
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param null|int $offset Offset
     * @param mixed    $value  Value to be set
     */
    public function offsetSet($offset, mixed $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param int $offset Offset
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     *
     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed returns data which can be serialized by json_encode(), which is a value
     *               of any type other than a resource
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize(): mixed
    {
        return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets a header-safe presentation of the object.
     */
    public function toHeaderValue(): string
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }

    /**
     * Array of nullable properties.
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null.
     *
     * @return bool[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null.
     *
     * @param bool[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
     * $this->openAPINullablesSetToNull array.
     *
     * @param mixed $defaultValue
     */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }
}
